home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Winter / rerun-1985-winter.d64 / make music (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  180 lines

  1. 1 poke52,56:poke56,56:clr:print"[147]please[157][157][157]waita[157][157][157][157][157]moment[157][157]for"
  2. 2 fori=1504to1543:pokei,3:next:print"create tunes 64"
  3. 3 print"  by:[157][157][157]arthur t. chakalis[157][157][157][157][157][157]copyright ,1984";
  4. 4 dim h(36),l(36),d(36),hn(22),ln(22),hs(22),ls(22),nd(16)
  5. 5 def fnr(sl)=int((sl-984)/40):def fnc(sl)=sl-(fnr(sl)*40)-983:gosub47
  6. 6 poke49152,65:poke49153,71:poke49155,227:poke49156,5:poke1507,71
  7. 7 rem main loop, to ml subr.& return  if firebutton pressed
  8. 8 sys49168:oc=peek(49152):nc=peek(49153)
  9. 9 sl=(256*peek(49156))+peek(49155):r=fnr(sl):c=fnc(sl)
  10. 10 ifr>23then20:rem routines at bottom of screen
  11. 11 ifc<4then8:rem out of range, notes can't be placed in 1st. 3 columns
  12. 12 ifoc<66then16:rem goto place note on staff
  13. 13 rem remove note from staff
  14. 14 poke49152,peek((r*40)+985):pokesl,peek(49152):h(c-3)=0:l(c-3)=0:gosub42
  15. 15 d(c-3)=0:pokesl,nc:goto8
  16. 16 ifd(c-3)<>0then8:rem place note ifa note isn't already in the column
  17. 17 pokesl+54272,13:d(c-3)=nd(nc-66):poke49152,nc:ifnc>74then19
  18. 18 h(c-3)=hn(r-1):l(c-3)=ln(r-1):pokesl+54272,11:goto8
  19. 19 h(c-3)=hs(r-1):l(c-3)=ls(r-1):pokesl+54272,11:goto8
  20. 20 ifoc>66thenpoke49153,oc:pokesl,oc:goto8:rem change note
  21. 21 ifoc<>9then32:rem change instrument
  22. 22 i=1+peek(1952)-48:ifi>8theni=1
  23. 23 ifi=1then w=65:ad=9:sr=0:hp=0:lp=255:goto31
  24. 24 ifi=2then w=17:ad=96:sr=60:hp=0:lp=0:goto31
  25. 25 ifi=3then w=33:ad=9:sr=0:hp=0:lp=0:goto31
  26. 26 ifi=4then w=17:ad=9:sr=0:hp=0:lp=0:goto31
  27. 27 ifi=5then w=17:ad=0:sr=240:hp=0:lp=0:goto31
  28. 28 ifi=6then w=33:ad=0:sr=240:hp=0:lp=0:goto31
  29. 29 ifi=7then w=17:ad=102:sr=0:hp=0:lp=0:goto31
  30. 30 ifi=8then w=33:ad=120:sr=0:hp=0:lp=0:goto31
  31. 31 poke1952,i+48:goto8
  32. 32 if oc<>20then35:rem change tempo
  33. 33 t=1+peek(1956)-48:ift>9thent=1
  34. 34 poke1956,t+48:goto8
  35. 35 ifoc<>16then 153:rem play notes
  36. 36 x=0:fori=1to36:ifd(i)=0then38
  37. 37 x=x+1:nexti
  38. 38 poke54274,lp:poke54275,hp:poke54277,ad:poke54278,sr:poke54296,v
  39. 39 fori=1tox:poke54276,w:poke54273,h(i):poke54272,l(i)
  40. 40 forj=0tod(i)/(1.4*t):nextj:poke54276,w-1:nexti
  41. 41 fori=54272to54300:pokei,0:nexti:goto8
  42. 42 s=54272: fori=stos+28:pokei,0:next
  43. 43 poke54296, 15 :poke54277,100  :poke54278,20
  44. 44 poke54276, 33 :poke54273, 56 :poke54272, 99
  45. 45 fori=1to 25 :next
  46. 46 fori=stos+28:pokei,0:next:return
  47. 47 printchr$(142):rem move character  mem. loc.
  48. 48 poke56334,peek(56334)and254
  49. 49 poke1,peek(1)and251
  50. 50 fori=0to511:pokei+14336,peek(i+53248):next
  51. 51 poke1,peek(1)or4
  52. 52 poke56334,peek(56334)or1
  53. 53 poke53272,(peek(53272)and240)or14
  54. 54 rem print instructions
  55. 55 print"[147]create tunes displays a musical staff."
  56. 56 print"a joystick in port2 moves a notearound. "
  57. 57 print"the fire button places/erases a note on  the staff."
  58. 58 print"the firebutton also does other functionswhen on the bottom line."
  59. 59 print"pressing it while over the following    does:"
  60. 60 print" notes=picks up any note shown               p=play notes entered"
  61. 61 print"     i=change instrument "
  62. 62 print"     t=change tempo"
  63. 63 print"     e=create basic code for tune &            deletes all else"
  64. 64 rem enter new character definitions
  65. 65 print"please wait a moment[145]":fori=512to599:readch:pokei+14336,ch:next
  66. 66 data 0,0,0,0,255,0,0,0,0,0,0,0,51,0,0,0,255,255,255,255,255,255,255,255
  67. 67 data 0,0,0,0,240,144,144,240,16,16,16,16,240,144,144,244,16,16,16,16,240
  68. 68 data 144,144,240,16,16,16,16,240,240,240,244,16,16,16,16,240,240,240,240
  69. 69 data 28,16,16,16,240,240,240,244,28,16,16,16,240,240,240,240
  70. 70 data 28,16,28,16,240,240,240,240
  71. 71 fori=536to599:pokei+14400,peek(i+14336):next
  72. 72 fori=600to663step8
  73. 73 pokei+14339,((peek(i+14339))+2)
  74. 74 pokei+14340,(peek(i+14340)+7)
  75. 75 pokei+14341,(peek(i+14341)+2):next
  76. 76 rem enter note data
  77. 77 fori=1to22:read hn(i),ln(i):next
  78. 78 fori=1to22:readhs(i),ls(i):next
  79. 79 fori=1to16:read nd(i):next
  80. 80 data25,30,22,96,21,31,18,209,16,195,15,210,14,24,12,143,11,48,10,143
  81. 81 data9,104,8,97,7,233,7,12,6,71,5,152,5,71,4,180,4,48
  82. 82 data3,244,3,134,3,35
  83. 83 data26,156,23,181,0,0,19,239,17,195,0,0,14,239,13,78,11,218,0,0
  84. 84 data9,247,8,225,0,0,7,119,6,167,5,237,0,0,4,251,4,112
  85. 85 data0,0,3,187,3,83
  86. 86 data1280,960,640,480,320,240,160,80,1280,960,640,480,320,240,160,80
  87. 87 rem poke ml subr. into mem.
  88. 88 for ad= 49168to 49351:read da:pokead,da:nextad
  89. 89 data 216, 173, 0, 220, 201, 111
  90. 90 data 240, 24, 201, 126, 240, 21
  91. 91 data 201, 125, 240, 40, 201, 123
  92. 92 data 240, 54, 201, 119, 240, 68
  93. 93 data 162, 160, 142, 5, 192, 76
  94. 94 data 17, 192, 96, 56, 173, 3
  95. 95 data 192, 233, 40, 133, 251, 173
  96. 96 data 4, 192, 233, 0, 133, 252
  97. 97 data 76, 123, 192, 133, 252, 76
  98. 98 data 123, 192, 24, 173, 3, 192
  99. 99 data 105, 40, 133, 251, 173, 4
  100. 100 data 192, 105, 0, 133, 252, 76
  101. 101 data 123, 192, 56, 173, 3, 192
  102. 102 data 233, 1, 133, 251, 173, 4
  103. 103 data 192, 233, 0, 133, 252, 76
  104. 104 data 123, 192, 24, 173, 3, 192
  105. 105 data 105, 1, 133, 251, 173, 4
  106. 106 data 192, 105, 0, 133, 252, 160
  107. 107 data 0, 177, 251, 201, 66, 208
  108. 108 data 3, 76, 17, 192, 141, 2
  109. 109 data 192, 173, 3, 192, 133, 253
  110. 110 data 173, 4, 192, 133, 254, 173
  111. 111 data 0, 192, 145, 253, 173, 2
  112. 112 data 192, 141, 0, 192, 173, 1
  113. 113 data 192, 145, 251, 165, 251, 141
  114. 114 data 3, 192, 165, 252, 141, 4
  115. 115 data 192, 173, 5, 192, 201, 32
  116. 116 data 240, 4, 56, 233, 32, 24
  117. 117 data 141, 5, 192, 170, 160, 0
  118. 118 data 136, 208, 253, 202, 208, 248
  119. 119 data 24, 76, 17, 192
  120. 120 print"press space bar to continue":gosub42
  121. 121 geta$:ifa$<>" "then121
  122. 122 rem screen setup
  123. 123 poke53280,15:poke53281,11:print"[147]":poke53281,15:poke646,11
  124. 124 print"[194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194][194]";
  125. 125 print"[194] g                                    [194]";
  126. 126 print"[194][192]f[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  127. 127 print"[194] e                                    [194]";
  128. 128 print"[194][192]d[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  129. 129 print"[194] c                                    [194]";
  130. 130 print"[194][192]b[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  131. 131 print"[194] a                                    [194]";
  132. 132 print"[194][192]g[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  133. 133 print"[194] f                                    [194]";
  134. 134 print"[194][192]e[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  135. 135 print"[194] d                                    [194]";
  136. 136 print"[194][193]c[193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][193][194]";
  137. 137 print"[194] b                                    [194]";
  138. 138 print"[194][192]a[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  139. 139 print"[194] g                                    [194]";
  140. 140 print"[194][192]f[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  141. 141 print"[194] e                                    [194]";
  142. 142 print"[194][192]d[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][194]";
  143. 143 print"[194] c                                    [19